<?php

namespace App\Store\Validate\Sysset;

use App\Common\Validate\BaseValidate;

/**
 * 权限组验证器
 */
class Classesset extends BaseValidate
{

    //验证规则
    protected $rule = [];
    //自定义验证信息
    protected $message = [];
    

    public function __construct($doaction = 'add')
    {
        if ($doaction == 'add') {
            $this->rule = [
                'store_ids' => 'required',
                'classes_name' => 'required',
            ];
            $this->message = [
                'store_ids.required' => '门店未选择',
                'classes_name.required' => '班次不能为空',
            ];
        } elseif ($doaction == 'edit') {
            $this->rule = [
                'id' => 'required|integer|gt:0',
                'classes_name' => 'required',
            ];
            $this->message = [
                'id.required' => '参数错误',
                'id.integer' => '参数错误',
                'id.gt' => '参数错误',
                'classes_name.required' => '班次不能为空',
            ];
        }
    }
}
